window.onload = function () {
  function browserRedirect() {
    let ua = navigator.userAgent;
    let isMobile = /Android|webOS|iPhone|iPod|BlackBerry/i.test(ua);
    console.log(isMobile)
    if (isMobile) {
      //跳转移动端页面
      document.write('<h1>此页面暂为开放移动端，后续敬请期待～</h1>')
      return false
    }else {
      return true
    }
  }
  function play(url, vaule) {
    let iframeDom = document.querySelector('iframe')
    iframeDom.src = `${vaule + url}`
  }
  if (browserRedirect()) {
    let inputDom = document.querySelector('.input')
    // 筛选框
    let selectDom = document.querySelector('.select')
    // 按钮
    let btnDom = document.querySelector('.btn')
    btnDom.onclick = function () {
      let inputValue = inputDom.value.trim()
      if (inputValue) {
        play(inputValue, selectDom.value)
      } else {
        alert('请输入链接，没链接我给你解析个毛线~')
      }
    }
  }
}
